package com.ruoyi.project.system.domain.vo;

import com.ruoyi.project.system.domain.SysProduct;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
public class ProductEquity {

    /**
     * 产品ID
     */
    private int productId;

    /**
     * 产品类型
     */
    private String productType;

    private String productName;

    /**
     * V0等级系统底价
     */
    private BigDecimal v0Pricing;

    /**
     * V1等级系统底价
     */
    private BigDecimal v1Pricing;

    /**
     * V2等级系统底价
     */
    private BigDecimal v2Pricing;

    /**
     * V3等级系统底价
     */

    private BigDecimal v3Pricing;

    /**
     * V4等级系统底价
     */
    private BigDecimal v4Pricing;

    /**
     * V5等级系统底价
     */
    private BigDecimal v5Pricing;

    /**
     * 系统底价
     */
    private BigDecimal customizedPrice;

    public ProductEquity(SysProduct sysProduct, BigDecimal sysFloorPrice, BigDecimal royalty) {
        this.productId = sysProduct.getProductId();
        this.productType = sysProduct.getProductType();
        this.productName = sysProduct.getProductName();
        this.v0Pricing = sysProduct.getV0Pricing().add(royalty);
        this.v1Pricing = sysProduct.getV1Pricing().add(royalty);
        this.v2Pricing = sysProduct.getV2Pricing().add(royalty);
        this.v3Pricing = sysProduct.getV3Pricing().add(royalty);
        this.v4Pricing = sysProduct.getV4Pricing().add(royalty);
        this.v5Pricing = sysProduct.getV5Pricing().add(royalty);
        this.customizedPrice = sysFloorPrice == null ? null : sysFloorPrice.add(royalty);
    }
}
